<template>
  <div class="MappinKnowledge" v-if="tabsList.length > 0">
    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
      <el-tab-pane
        v-for="(item, index) in tabsList"
        :key="index"
        :label="item.label"
        :name="index"
      >
        <div><b>访问链接：</b>{{ data.link }}</div>
        <div><b>访问密码：</b>{{ data.password }}</div>
        <div>
          <img
            :src="data.image"
            alt=""
            style="max-width: 100%; margin-top: 10px"
          />
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script setup>
import { ref, h, onMounted } from "vue";
const tabsList = ref([
  { label: "知识图谱", name: "caseIntroduce" },
  { label: "" },
]);
const activeTab = ref({});
const activeName = ref(0);

const handleClick = (tab, event) => {
  activeTab.value = {};
  activeName.value = tab.props.name;
  activeTab.value = tabsList.value[activeName.value];
};
const props = defineProps({
  data: {
    type: Object,
    default: () => {},
  },
});
</script>

<style lang="less" scoped>
.MappinKnowledge {
  // padding: 20px;
  line-height: 2;
  .demo-tabs {
    :deep(.el-tabs__header) {
      .el-tabs__item {
        height: 40px;
        line-height: 40px;
        font-weight: bold;
        padding: 10px 20px;
      }
    }
    :deep(.el-tabs__content) {
      padding: 10px 0;
    }
    :deep(.el-tabs__nav-wrap::after) {
      height: 1px;
    }
    :deep(.el-tabs__item.is-active) {
      color: #217300;
    }
    :deep(.el-tabs__item:hover) {
      color: #217300;
    }
    :deep(.el-tabs__active-bar) {
      background-color: #217300;
    }
    :deep(.el-tabs__nav-wrap:after) {
      display: none;
    }
  }
}
</style>
